package com.xiaobai.zhuangxiuguanjia.client;

import android.util.Log;

import com.xiaobai.zhuangxiuguanjia.Utils.CommonHttpUtil;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;

/**
 * Created by gggcccwww on 2015/6/16.
 */
public class FindCompanyAPI {
    public static JSONObject getJSONObject(String path,HashMap<String,String> params) {
        JSONObject ret=null;
        byte[] jsonObjectBytes = CommonHttpUtil.doPost(path, params, null);
        if(jsonObjectBytes!=null){
            String jsonStr = null;
            try {
                jsonStr = new String(jsonObjectBytes, "UTF-8");
                Log.d("----->jsonStr", jsonStr);
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            try {
                ret=new JSONObject(jsonStr);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        return ret;
    }
}
